<?php

namespace App\Exports\Sheet;

use Illuminate\Database\Eloquent\Model;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;

trait SheetTrait
{
    private string $title;

    private int $count;

    private array $columns;



    /**
     * @param Worksheet $sheet
     */
    public function styles(Worksheet $sheet): void
    {

    }


    /**
     * 设置列宽
     * @return array
     */
    public function columnWidths(): array
    {
        return [
            'B' => 30,
        ];
    }

    /**
     * @return array
     */
    public function columnFormats(): array
    {
        return [
            //'J' => NumberFormat::FORMAT_NUMBER_00,
        ];
    }

    /**
     * @return array
     */
    public function headings(): array
    {
        return $this->columns;
    }

    /**
     * sheet表名称
     * @return string
     */
    public function title(): string
    {
        return $this->title;
    }
}
